/**
 * XBACnet Web Management Interface
 * Main SCSS styles
 */

// Variables
:root {
  --primary-color: #409eff;
  --success-color: #67c23a;
  --warning-color: #e6a23c;
  --danger-color: #f56c6c;
  --info-color: #909399;
  
  --sidebar-bg: #304156;
  --sidebar-text: #bfcbd9;
  --sidebar-active: #409eff;
  
  --header-bg: #fff;
  --header-text: #303133;
  
  --main-bg: #f5f5f5;
  --card-bg: #fff;
  
  --border-color: #e4e7ed;
  --text-primary: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --text-placeholder: #c0c4cc;
}

// Dark theme
[data-theme="dark"] {
  --sidebar-bg: #1f2937;
  --sidebar-text: #9ca3af;
  --sidebar-active: #60a5fa;
  
  --header-bg: #374151;
  --header-text: #f9fafb;
  
  --main-bg: #111827;
  --card-bg: #1f2937;
  
  --border-color: #4b5563;
  --text-primary: #f9fafb;
  --text-regular: #d1d5db;
  --text-secondary: #9ca3af;
  --text-placeholder: #6b7280;
}

// Global styles
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100vh;
  overflow: hidden;
}

// Layout styles
.app-container {
  height: 100vh;
}

.sidebar {
  background-color: var(--sidebar-bg);
  transition: width 0.3s;
  overflow: hidden;
  box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
}

.header {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  height: 60px;
  line-height: 60px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

.main-content {
  background-color: var(--main-bg);
  padding: 20px;
  overflow-y: auto;
  min-height: calc(100vh - 60px);
}

// Card styles
.content-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

// Table styles
.data-table {
  .el-table {
    background-color: var(--card-bg);
  }
  
  .el-table th {
    background-color: var(--main-bg);
    color: var(--text-primary);
  }
  
  .el-table td {
    color: var(--text-regular);
  }
}

// Form styles
.form-container {
  .el-form-item__label {
    color: var(--text-primary);
    font-weight: 500;
  }
  
  .el-input__inner {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
  }
  
  .el-textarea__inner {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
  }
}

// Button styles
.action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  
  .el-button {
    border-radius: 6px;
  }
}

// Status indicators
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  
  &.active {
    color: var(--success-color);
  }
  
  &.inactive {
    color: var(--danger-color);
  }
  
  &.normal {
    color: var(--success-color);
  }
  
  &.fault {
    color: var(--danger-color);
  }
  
  &.offnormal {
    color: var(--warning-color);
  }
}

// Responsive design
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 1000;
    height: 100vh;
  }
  
  .main-content {
    margin-left: 0;
    padding: 10px;
  }
  
  .content-card {
    padding: 15px;
  }
}

// Animation classes
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: transform 0.3s;
}

.slide-enter-from {
  transform: translateX(-100%);
}

.slide-leave-to {
  transform: translateX(100%);
}

// Utility classes
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.p-10 {
  padding: 10px;
}

.p-20 {
  padding: 20px;
}

// Loading overlay
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
